.set LOCALID_GRUNT1, 2
.set LOCALID_GRUNT2, 3

MtEmber_Exterior_MapScripts:: @ 8163946
@	map_script MAP_SCRIPT_ON_TRANSITION, MtEmber_Exterior_OnTransition
@	map_script MAP_SCRIPT_ON_LOAD, MtEmber_Exterior_OnLoad
	.byte 0

MtEmber_Exterior_OnTransition:: @ 8163951
@	setworldmapflag FLAG_WORLD_MAP_MT_EMBER_EXTERIOR
@	compare VAR_MAP_SCENE_MT_EMBER_EXTERIOR, 2
@	call_if_eq MtEmber_Exterior_EventScript_RocketsFaceDown
	end

MtEmber_Exterior_EventScript_RocketsFaceDown:: @ 8163960
@	setobjectmovementtype LOCALID_GRUNT1, MOVEMENT_TYPE_FACE_DOWN
@	setobjectmovementtype LOCALID_GRUNT2, MOVEMENT_TYPE_FACE_DOWN
@	return

MtEmber_Exterior_OnLoad:: @ 8163969
@	compare VAR_MAP_SCENE_ONE_ISLAND_POKEMON_CENTER_1F, 4
@	call_if_ge MtEmber_Exterior_EventScript_OpenCave
	end

MtEmber_Exterior_EventScript_OpenCave:: @ 8163975
@	setmetatile 42, 39, METATILE_MtEmber_CaveEntrance, 0
@	return

MtEmber_Exterior_EventScript_Grunt1:: @ 816397F
	lock
@	goto_if_defeated TRAINER_TEAM_ROCKET_GRUNT_43, MtEmber_Exterior_EventScript_Grunt1Defeated
@	compare VAR_MAP_SCENE_ONE_ISLAND_POKEMON_CENTER_1F, 4
@	goto_if_eq MtEmber_Exterior_EventScript_BattleGrunt1
	msgbox MtEmber_Exterior_Text_WellTryDiggingHere
	closemessage
	release
	end

MtEmber_Exterior_EventScript_Grunt1Defeated:: @ 816399E
@	msgbox MtEmber_Exterior_Text_Grunt1PostBattle
@	release
	end

MtEmber_Exterior_EventScript_BattleGrunt1:: @ 81639A8
@	applymovement LOCALID_GRUNT1, Movement_FacePlayer
@	waitmovement 0
@	playbgm MUS_ENCOUNTER_ROCKET, 0
@	msgbox MtEmber_Exterior_Text_Grunt1Intro
@	trainerbattle_no_intro TRAINER_TEAM_ROCKET_GRUNT_43, MtEmber_Exterior_Text_Grunt1Defeat
@	msgbox MtEmber_Exterior_Text_Grunt1PostBattle
@	goto_if_defeated TRAINER_TEAM_ROCKET_GRUNT_44, MtEmber_Exterior_EventScript_DefeatedBothGrunts
@	release
	end

MtEmber_Exterior_EventScript_DefeatedBothGrunts:: @ 81639DB
@	msgbox MtEmber_Exterior_Text_WellRegroupDontStepInsideThere
@	closemessage
@	fadescreen FADE_TO_BLACK
@	removeobject LOCALID_GRUNT1
@	removeobject LOCALID_GRUNT2
@	fadescreen FADE_FROM_BLACK
@	release
	end

MtEmber_Exterior_EventScript_Grunt2:: @ 81639F0
	lock
@	faceplayer
@	goto_if_defeated TRAINER_TEAM_ROCKET_GRUNT_44, MtEmber_Exterior_EventScript_DefeatedGrunt2
@	compare VAR_MAP_SCENE_ONE_ISLAND_POKEMON_CENTER_1F, 4
@	goto_if_eq MtEmber_Exterior_EventScript_BattleGrunt2
	msgbox MtEmber_Exterior_Text_YoureInTheWayGetLost
	closemessage
@	applymovement LOCALID_GRUNT2, Movement_FaceOriginalDirection
@	waitmovement 0
	release
	end

MtEmber_Exterior_EventScript_DefeatedGrunt2:: @ 8163A1B
@	msgbox MtEmber_Exterior_Text_Grunt2PostBattle
@	release
	end

MtEmber_Exterior_EventScript_BattleGrunt2:: @ 8163A25
@	playbgm MUS_ENCOUNTER_ROCKET, 0
@	msgbox MtEmber_Exterior_Text_Grunt2Intro
@	trainerbattle_no_intro TRAINER_TEAM_ROCKET_GRUNT_44, MtEmber_Exterior_Text_Grunt2Defeat
@	msgbox MtEmber_Exterior_Text_Grunt2PostBattle
@	goto_if_defeated TRAINER_TEAM_ROCKET_GRUNT_43, MtEmber_Exterior_EventScript_DefeatedBothGrunts
@	release
	end

MtEmber_Exterior_EventScript_RocketPasswordScene:: @ 8163A4E
@	lockall
@	textcolor 0
@	msgbox MtEmber_Exterior_Text_PunchedThroughAtLast
@	message MtEmber_Exterior_Text_WhatsPasswordAgain
@	waitmessage
@	playse SE_PIN
@	applymovement LOCALID_GRUNT2, Movement_QuestionMark
@	waitmovement 0
@	waitbuttonpress
@	msgbox MtEmber_Exterior_Text_FirstPasswordGoldeen
@	applymovement LOCALID_GRUNT1, Movement_WalkInPlaceFastestDown
@	waitmovement 0
@	playse SE_PIN
@	applymovement LOCALID_GRUNT1, Movement_ExclamationMark
@	waitmovement 0
@	applymovement LOCALID_GRUNT1, Movement_Delay48
@	waitmovement 0
@	applymovement LOCALID_GRUNT2, Movement_WalkInPlaceFastestDown
@	waitmovement 0
@	call MtEmber_Exterior_EventScript_RocketsFaceDown
@	msgbox MtEmber_Exterior_Text_SnoopsBeenListeningIn
@	setvar VAR_MAP_SCENE_MT_EMBER_EXTERIOR, 2
@	releaseall
	end

MtEmber_Exterior_EventScript_Logan:: @ 8163AB4
	trainerbattle_single TRAINER_PKMN_RANGER_LOGAN, MtEmber_Exterior_Text_LoganIntro, MtEmber_Exterior_Text_LoganDefeat
	msgbox MtEmber_Exterior_Text_LoganPostBattle, MSGBOX_AUTOCLOSE
	end

MtEmber_Exterior_EventScript_Beth:: @ 8163ACB
	trainerbattle_single TRAINER_PKMN_RANGER_BETH, MtEmber_Exterior_Text_BethIntro, MtEmber_Exterior_Text_BethDefeat
	msgbox MtEmber_Exterior_Text_BethPostBattle, MSGBOX_AUTOCLOSE
	end

MtEmber_Exterior_EventScript_Jocelyn:: @ 8163AE2
	trainerbattle_single TRAINER_CRUSH_GIRL_JOCELYN, MtEmber_Exterior_Text_JocelynIntro, MtEmber_Exterior_Text_JocelynDefeat
	msgbox MtEmber_Exterior_Text_JocelynPostBattle, MSGBOX_AUTOCLOSE
	end

MtEmber_Exterior_Text_LoganIntro:
.string "活火山是指正在喷发的，\n或将要喷发的火山。$"
MtEmber_Exterior_Text_LoganDefeat:
.string "呜……太热了！\n汗山爆发啊！$"
MtEmber_Exterior_Text_LoganPostBattle:
.string "有人说世界上有超过1500个活火山。\p只是想想就让我感到全身发热！$"
MtEmber_Exterior_Text_BethIntro:
.string "你知道火山中的洞穴是如何形成的吗？$"
MtEmber_Exterior_Text_BethDefeat:
.string "啊！\n你真是令人震惊的强大！$"
MtEmber_Exterior_Text_BethPostBattle:
.string "当岩浆表面的熔岩变硬，\n其内部的岩浆流了出来，\p洞穴就形成了。$"
MtEmber_Exterior_Text_JocelynIntro:
.string "我不断地锻炼来修补\n我破碎的心……\p那至少让我在身体上更坚韧！\n嗬呀！$"
MtEmber_Exterior_Text_JocelynDefeat:
.string "我觉得我做太过了……$"
MtEmber_Exterior_Text_JocelynPostBattle:
.string "你战斗的方式，\n使我想起了甩了我的家伙……$"

@will be remove in future
MtEmber_Exterior_Text_WellTryDiggingHere:
.string "天哪！\n明天就到我们的婚礼了！\p我要去海边举行婚礼，\n要穿好看的衣服。\p{PLAYER}:搁着秀恩爱呢！$"
MtEmber_Exterior_Text_YoureInTheWayGetLost:
.string "啊，这蓝蓝的天，白白的云，\n还有对面的美人，真爽！\p...\p...\p...\p你是谁！\n请不要打扰我们谈恋爱！$"
Text_ExplosionTaught:
.string "嗯？\n你觉得我可疑？\p不是，我曾经最爱的人现在要结婚了，\n我很伤心，所以就在这里苦恼。\p唉…\n什么。\p你说我活该？\n算了算了，你走吧。$"

